From 7e6820415d407eb4cd806595e97bec1664042322 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Dec 2016 11:07:05 -0500 Subject: [PATCH] Avoid a possible crash in ::activate-url handlers If the signal handler ends up changing the label text, the link is no longer around to update the css node. Check for this possibility to avoid a crash here. --- gtk/gtklabel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 9b759bea1b..10e69f49bc 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -6611,7 +6611,8 @@ emit_activate_link (GtkLabel *label, GtkStateFlags state; g_signal_emit (label, signals[ACTIVATE_LINK], 0, link->uri, &handled); - if (handled && priv->track_links && !link->visited) + if (handled && priv->track_links && !link->visited && + priv->select_info && priv->select_info->links) { link->visited = TRUE; state = gtk_css_node_get_state (link->cssnode); -- 2.30.2